#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>
#include <set>

using namespace std;
using LL = long long;
const int N = 63;

int n, m;
LL d[N];
vector<int> idx;
vector<LL> res;
set<LL> kk;


void init(){
    d[1] = 1;
    for(int i = 2; i < N; i ++){
        d[i] = d[i - 1] * 2;
    }
}



int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    init();

    LL x;
    scanf("%lld", &x);

    for(int i = 1; i < N; i ++){
        if((x >> (i - 1)) & 1){
            idx.push_back(i);
        }
    }
    m = idx.size();
    for(int i = 0; i < (1 << m); i ++){
        LL t = 0;
        for(int j = 0; j < m; j ++){
            if((i >> j) & 1) t += d[idx[j]];
        }
        res.push_back(t);
    }

    for(int i = 0; i < res.size(); i ++){
        printf("%lld\n", res[i]);
    }

    return 0;
}